const fs = require('fs');

const userRouter = function () {
   fs.readdirSync(__dirname).forEach(file => {
    //    console.log(file);
       if(file === 'index.js') return;
       const router = require(`./${file}`);
       this.use(router.routes());
       this.use(router.allowedMethods());
   })
}

module.exports = userRouter;
